<?php

/**
 * Helper functions.
 * 
 * @author Volker Kueffel <volker.kueffel@gmail.com>
 * @version $Id: Utils.class.php 18 2009-01-05 02:18:30Z volker.kueffel $
 */
class Utils {

	/**
	 * Create StdClass out of array.
	 * 
	 * Field names are built using the array keys,
	 * values are the array values. Numeric keys are
	 * ignored.
	 * 
	 * @param array $input the array to convert
	 * 
	 * @return StdClass object created from array
	 */
	public static function array2Object($input) {
   		$result=new StdClass();
   		foreach ($input as $key=>$value) {
 			if (!is_numeric($key)) {
 				$result->$key=$value;
 			}  			
   		}
   		return $result;
	}
}
?>